﻿using System.Collections.Generic;

namespace Game.Utilities
{
    public enum TypeEat
    {
        Normal =0,
        Hu=1,
        Free15=2,
        Free5 =3,
        Free1 =4,
        PandaX1 =5,
        PandaX5 =6

    }


    public class Item
    {
        public int Id { set; get; }

        public Item()
        {

        }
    }

    public class ResultBet
    {
        public Item[,] Items { set; get; }

        public int Prize { set; get; }

        public int PrizeValue { set; get; }

        public List<LineWin> LineWin { set; get; }

        public int PrizeRoom { set; get; }

        public bool IsWin { set; get; }

        public ResultBet()
        {
            Items = new Item[3, 5];
            Prize = 0;
            PrizeValue = 0;
            PrizeRoom = 0;
            LineWin = new List<LineWin>();
        }
    }

    public class LineWin
    {

        public int LineId { set; get; }

        public int ItemId { set; get; }

        public int CountItem { set; get; }

        public TypeEat Eat { set; get; }

        public int PrizeValue { set; get; }



        public LineWin(int lineId, int itemId, int countItem, int prizeRoom)
        {
            LineId = lineId;
            ItemId = itemId;
            CountItem = countItem;
            switch (itemId)
            {
                case 1:
                    switch (countItem)
                    {
                        case 5:
                            PrizeValue = prizeRoom * 5000;
                            Eat = TypeEat.Hu;
                            break;
                        case 4:
                            Eat = TypeEat.Normal;
                            PrizeValue = 30 * prizeRoom;
                            break;
                        default:
                            Eat = TypeEat.Normal;
                            PrizeValue = 5 * prizeRoom;
                            break;
                    }
                    break;
                case 2:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Normal;
                            PrizeValue = 8000 * prizeRoom;
                            break;
                        case 4:
                            Eat = TypeEat.PandaX5;
                            PrizeValue = 5 * prizeRoom * 50;
                            break;
                        default:
                            Eat = TypeEat.PandaX1;
                            PrizeValue = prizeRoom * 50;
                            break;
                    }
                    break;
                case 3:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Normal;
                            PrizeValue = 500 * prizeRoom;
                            break;
                        case 4:
                            Eat = TypeEat.Normal;
                            PrizeValue = 20 * prizeRoom;
                            break;
                        default:
                            Eat = TypeEat.Normal;
                            PrizeValue = prizeRoom * 4;
                            break;
                    }
                    break;
                case 4:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Normal;
                            PrizeValue = 200 * prizeRoom;
                            break;
                        case 4:
                            Eat = TypeEat.Normal;
                            PrizeValue = 15 * prizeRoom;
                            break;
                        default:
                            Eat = TypeEat.Normal;
                            PrizeValue = prizeRoom * 3;
                            break;
                    }
                    break;
                case 5:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Normal;
                            PrizeValue = 75 * prizeRoom;
                            break;
                        case 4:
                            Eat = TypeEat.Normal;
                            PrizeValue = 10 * prizeRoom;
                            break;
                        default:
                            Eat = TypeEat.Normal;
                            PrizeValue = prizeRoom * 2;
                            break;
                    }
                    break;
                case 6:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Normal;
                            PrizeValue = 30 * prizeRoom;
                            break;
                        case 4:
                            Eat = TypeEat.Normal;
                            PrizeValue = 6 * prizeRoom;
                            break;
                        case 3:
                            Eat = TypeEat.Normal;
                            break;
                    }
                    break;
                case 7:
                    switch (countItem)
                    {
                        case 5:
                            Eat = TypeEat.Free15;
                            break;
                        case 4:
                            Eat = TypeEat.Free5;
                            break;
                        default:
                            Eat = TypeEat.Free1;
                            break;
                    }
                    break;

            }


        }

    }
}
